import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 转义字符
 * 日期 2022/5/5 8:42
 * 创建者：john driver
 * ()[]{} : \\( \\) \\[ \\] \\{ \\}
 * . * + ? :  \\. \\* \\+ \\?
 * ^ $ :   \\^ \\$
 * \ : \\\\
 */
public class EscapeCharacter {
    public static void main(String[] args) {
        Pattern pattern = Pattern.compile("[\\\\]");
        Matcher matcher = pattern.matcher("(hello.*+?{}[]^$\\)");
        while (matcher.find()){
            System.out.println(matcher.group(0));
        }
    }
}
